package zhieasy.cn.persistence.mapper.common;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import zhieasy.cn.model.common.Permission;

import java.util.List;

/**
 * @author DaHang
 * @date 2020/8/13 18:03
 */
@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {

    /**
     * 根据openId查询用户权限
     * @param openId
     * @return
     */
    List<Permission> selectPermissionByOpenId(@Param("openId") String openId);

    /**
     * 根据角色Id查询所有的权限
     * @param roleId
     * @return
     */
    List<Permission> findByRoleId(@Param("roleId") Long roleId);
}
